]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Disconnect from parental controls on destroy
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 16 Sep 2020 17:44:49 +0000 (14:44 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 16 Sep 2020 17:57:02 +0000 (14:57 -0300)
BaseAppView not disconnecting from the 'app-filter-changed'
signal means parental controls may trigger callbacks on
a destroyed grid, which tries to access destroyed icons,
which spams the journal with stack traces.

Disconnect from parental controls when BaseAppView is destroyed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1441

js/ui/appDisplay.js

index 68fdbdd0e713c475f6b9ff9979c03e5588fce451..f9e6a9b7da4e8c63709c60ee1308cd87d733dd92 100644 (file)
@@ -188,9 +188,10 @@ var BaseAppView = GObject.registerClass({
 
         // Filter the apps through the user’s parental controls.
         this._parentalControlsManager = ParentalControlsManager.getDefault();
-        this._parentalControlsManager.connect('app-filter-changed', () => {
-            this._redisplay();
-        });
+        this._appFilterChangedId =
+            this._parentalControlsManager.connect('app-filter-changed', () => {
+                this._redisplay();
+            });
 
         // Drag n' Drop
         this._lastOvershoot = -1;
@@ -206,6 +207,10 @@ var BaseAppView = GObject.registerClass({
     }
 
     _onDestroy() {
+        if (this._appFilterChangedId > 0) {
+            this._parentalControlsManager.disconnect(this._appFilterChangedId);
+            this._appFilterChangedId = 0;
+        }
         this._removeDelayedMove();
         this._disconnectDnD();
     }